********************************************************************************
**  TITLE:      on2014_ipsos_contact_networks                                 **  
**  AUTHOR:	    Philippe Mongrain                                             **
**  DATA:       2014 Ontario General Election Exit Survey                     **
**  DATE:	    October 2022 						                          **	
**  VERSION:	Stata 16					                                  **	
********************************************************************************

* Version control

version 16.0

* Open log file

capture log close       			  			              
log using "on2014_ipsos_contact_networks", replace

* Open the dataset

import spss using "2014 Ontario General Election Exit Survey.sav", clear case(lower)


***********************
** DISTRICT OUTCOMES **
***********************

* Election outcome in each district (1 = OPC, 2 = OLP, 3 = ONDP, 4 = other)

gen district_outcome = .

replace district_outcome = 2 if riding == 3501
replace district_outcome = 3 if riding == 3502
replace district_outcome = 2 if riding == 3503
replace district_outcome = 2 if riding == 3504
replace district_outcome = 2 if riding == 3505
replace district_outcome = 3 if riding == 3506
replace district_outcome = 2 if riding == 3507
replace district_outcome = 2 if riding == 3508
replace district_outcome = 2 if riding == 3509
replace district_outcome = 1 if riding == 35010
replace district_outcome = 2 if riding == 35011
replace district_outcome = 2 if riding == 35012
replace district_outcome = 1 if riding == 35013
replace district_outcome = 1 if riding == 35014
replace district_outcome = 2 if riding == 35015
replace district_outcome = 2 if riding == 35016
replace district_outcome = 2 if riding == 35017
replace district_outcome = 1 if riding == 35018
replace district_outcome = 2 if riding == 35019
replace district_outcome = 2 if riding == 35020
replace district_outcome = 1 if riding == 35021
replace district_outcome = 3 if riding == 35022
replace district_outcome = 2 if riding == 35023
replace district_outcome = 2 if riding == 35024
replace district_outcome = 2 if riding == 35025
replace district_outcome = 2 if riding == 35026
replace district_outcome = 2 if riding == 35027
replace district_outcome = 1 if riding == 35028
replace district_outcome = 1 if riding == 35029
replace district_outcome = 2 if riding == 35030
replace district_outcome = 3 if riding == 35031
replace district_outcome = 3 if riding == 35032
replace district_outcome = 3 if riding == 35033
replace district_outcome = 1 if riding == 35034
replace district_outcome = 3 if riding == 35035
replace district_outcome = 2 if riding == 35036
replace district_outcome = 2 if riding == 35037
replace district_outcome = 1 if riding == 35038
replace district_outcome = 3 if riding == 35039
replace district_outcome = 1 if riding == 35040
replace district_outcome = 1 if riding == 35041
replace district_outcome = 1 if riding == 35042
replace district_outcome = 3 if riding == 35043
replace district_outcome = 2 if riding == 35044
replace district_outcome = 3 if riding == 35045
replace district_outcome = 2 if riding == 35046
replace district_outcome = 2 if riding == 35047
replace district_outcome = 2 if riding == 35048
replace district_outcome = 2 if riding == 35049
replace district_outcome = 2 if riding == 35050
replace district_outcome = 2 if riding == 35051
replace district_outcome = 1 if riding == 35052
replace district_outcome = 2 if riding == 35053
replace district_outcome = 3 if riding == 35054
replace district_outcome = 1 if riding == 35055
replace district_outcome = 3 if riding == 35056
replace district_outcome = 1 if riding == 35057
replace district_outcome = 2 if riding == 35058
replace district_outcome = 2 if riding == 35059
replace district_outcome = 2 if riding == 35060
replace district_outcome = 3 if riding == 35061
replace district_outcome = 2 if riding == 35062
replace district_outcome = 2 if riding == 35063
replace district_outcome = 2 if riding == 35064
replace district_outcome = 2 if riding == 35065
replace district_outcome = 2 if riding == 35066
replace district_outcome = 1 if riding == 35067
replace district_outcome = 3 if riding == 35068
replace district_outcome = 1 if riding == 35069
replace district_outcome = 1 if riding == 35070
replace district_outcome = 2 if riding == 35071
replace district_outcome = 2 if riding == 35072
replace district_outcome = 1 if riding == 35073
replace district_outcome = 1 if riding == 35074
replace district_outcome = 2 if riding == 35075
replace district_outcome = 2 if riding == 35076
replace district_outcome = 2 if riding == 35077
replace district_outcome = 1 if riding == 35078
replace district_outcome = 2 if riding == 35079
replace district_outcome = 2 if riding == 35080
replace district_outcome = 2 if riding == 35081
replace district_outcome = 2 if riding == 35082
replace district_outcome = 2 if riding == 35083
replace district_outcome = 2 if riding == 35084
replace district_outcome = 1 if riding == 35085
replace district_outcome = 1 if riding == 35086
replace district_outcome = 1 if riding == 35087
replace district_outcome = 3 if riding == 35088
replace district_outcome = 1 if riding == 35089
replace district_outcome = 2 if riding == 35090
replace district_outcome = 2 if riding == 35091
replace district_outcome = 3 if riding == 35092
replace district_outcome = 3 if riding == 35093
replace district_outcome = 2 if riding == 35094
replace district_outcome = 3 if riding == 35095
replace district_outcome = 2 if riding == 35096
replace district_outcome = 2 if riding == 35097
replace district_outcome = 3 if riding == 35098
replace district_outcome = 1 if riding == 35099
replace district_outcome = 1 if riding == 35100
replace district_outcome = 2 if riding == 35101
replace district_outcome = 3 if riding == 35102
replace district_outcome = 3 if riding == 35103
replace district_outcome = 2 if riding == 35104
replace district_outcome = 1 if riding == 35105
replace district_outcome = 2 if riding == 35106
replace district_outcome = 2 if riding == 35107


*********************
** COMPETITIVENESS **
*********************

* Margin of victory by district

gen margin = .

replace margin = 21.89421 if riding == 3501
replace margin = 28.89609 if riding == 3502
replace margin = 10.73037 if riding == 3503
replace margin = 4.595234 if riding == 3504
replace margin = 1.119957 if riding == 3505
replace margin = 10.63838 if riding == 3506
replace margin = 8.080471 if riding == 3507
replace margin = 20.88995 if riding == 3508
replace margin = 7.661415 if riding == 3509
replace margin = 20.49 if riding == 35010
replace margin = 6.42067 if riding == 35011
replace margin = 6.367088 if riding == 35012
replace margin = 15.7063 if riding == 35013
replace margin = 6.719126 if riding == 35014
replace margin = 5.466167 if riding == 35015
replace margin = 28.91919 if riding == 35016
replace margin = 26.38756 if riding == 35017
replace margin = 9.194082 if riding == 35018
replace margin = 2.163113 if riding == 35019
replace margin = 21.04253 if riding == 35020
replace margin = 19.72423 if riding == 35021
replace margin = 38.51717 if riding == 35022
replace margin = 17.55777 if riding == 35023
replace margin = 13.13461 if riding == 35024
replace margin = 18.69142 if riding == 35025
replace margin = 17.17361 if riding == 35026
replace margin = 20.68081 if riding == 35027
replace margin = 29.06234 if riding == 35028
replace margin = 5.921761 if riding == 35029
replace margin = 7.68536 if riding == 35030
replace margin = 28.50348 if riding == 35031
replace margin = 17.64899 if riding == 35032
replace margin = 17.32341 if riding == 35033
replace margin = 8.144213 if riding == 35034
replace margin = 30.15935 if riding == 35035
replace margin = 12.02778 if riding == 35036
replace margin = 16.16685 if riding == 35037
replace margin = 3.020241 if riding == 35038
replace margin = 7.294933 if riding == 35039
replace margin = 18.64898 if riding == 35040
replace margin = 13.72895 if riding == 35041
replace margin = 35.57581 if riding == 35042
replace margin = 27.3375 if riding == 35043
replace margin = 5.549578 if riding == 35044
replace margin = 10.79375 if riding == 35045
replace margin = 17.35853 if riding == 35046
replace margin = 20.98589 if riding == 35047
replace margin = 26.13684 if riding == 35048
replace margin = 19.09049 if riding == 35049
replace margin = 17.56216 if riding == 35050
replace margin = 24.50191 if riding == 35051
replace margin = 13.51081 if riding == 35052
replace margin = 6.519787 if riding == 35053
replace margin = 14.58869 if riding == 35054
replace margin = 13.47895 if riding == 35055
replace margin = 40.71698 if riding == 35056
replace margin = 15.027 if riding == 35057
replace margin = 7.039051 if riding == 35058
replace margin = 8.08123 if riding == 35059
replace margin = 11.58343 if riding == 35060
replace margin = 16.15695 if riding == 35061
replace margin = 31.55057 if riding == 35062
replace margin = 20.36669 if riding == 35063
replace margin = 17.85669 if riding == 35064
replace margin = 33.26456 if riding == 35065
replace margin = 10.95785 if riding == 35066
replace margin = 20.45073 if riding == 35067
replace margin = 1.206394 if riding == 35068
replace margin = 14.47878 if riding == 35069
replace margin = 5.863865 if riding == 35070
replace margin = 16.50447 if riding == 35071
replace margin = 23.66217 if riding == 35072
replace margin = 9.035439 if riding == 35073
replace margin = 41.96061 if riding == 35074
replace margin = 11.24322 if riding == 35075
replace margin = 11.29982 if riding == 35076
replace margin = 35.79316 if riding == 35077
replace margin = 5.246437 if riding == 35078
replace margin = 33.06117 if riding == 35079
replace margin = 15.21627 if riding == 35080
replace margin = 33.47814 if riding == 35081
replace margin = 21.88643 if riding == 35082
replace margin = 7.397257 if riding == 35083
replace margin = 26.57541 if riding == 35084
replace margin = 15.93596 if riding == 35085
replace margin = 11.42891 if riding == 35086
replace margin = 28.52128 if riding == 35087
replace margin = 2.894093 if riding == 35088
replace margin = .2130623 if riding == 35089
replace margin = 24.86823 if riding == 35090
replace margin = 26.51037 if riding == 35091
replace margin = 32.26746 if riding == 35092
replace margin = 27.11562 if riding == 35093
replace margin = 39.91991 if riding == 35094
replace margin = 7.455196 if riding == 35095
replace margin = 15.96789 if riding == 35096
replace margin = 28.03763 if riding == 35097
replace margin = 18.38433 if riding == 35098
replace margin = 17.29472 if riding == 35099
replace margin = 9.152428 if riding == 35100
replace margin = 19.10902 if riding == 35101
replace margin = 46.90548 if riding == 35102
replace margin = 2.868073 if riding == 35103
replace margin = 16.43053 if riding == 35104
replace margin = 5.838253 if riding == 35105
replace margin = 10.59301 if riding == 35106
replace margin = 7.491959 if riding == 35107

* Effective number of electoral parties by district

gen enep = .

replace enep = 2.682988 if riding == 3501
replace enep = 2.65602 if riding == 3502
replace enep = 2.943528 if riding == 3503
replace enep = 3.064585 if riding == 3504
replace enep = 2.98422 if riding == 3505
replace enep = 2.915204 if riding == 3506
replace enep = 3.11343 if riding == 3507
replace enep = 3.114605 if riding == 3508
replace enep = 3.259235 if riding == 3509
replace enep = 3.012555 if riding == 35010
replace enep = 2.877239 if riding == 35011
replace enep = 3.251334 if riding == 35012
replace enep = 2.856908 if riding == 35013
replace enep = 3.305314 if riding == 35014
replace enep = 2.649685 if riding == 35015
replace enep = 2.49654 if riding == 35016
replace enep = 2.348813 if riding == 35017
replace enep = 3.39809 if riding == 35018
replace enep = 3.221646 if riding == 35019
replace enep = 2.377106 if riding == 35020
replace enep = 3.031213 if riding == 35021
replace enep = 2.308205 if riding == 35022
replace enep = 2.663435 if riding == 35023
replace enep = 2.772435 if riding == 35024
replace enep = 3.091391 if riding == 35025
replace enep = 2.701313 if riding == 35026
replace enep = 3.51691 if riding == 35027
replace enep = 2.720118 if riding == 35028
replace enep = 3.018603 if riding == 35029
replace enep = 2.805768 if riding == 35030
replace enep = 2.826093 if riding == 35031
replace enep = 2.961627 if riding == 35032
replace enep = 2.929102 if riding == 35033
replace enep = 3.314562 if riding == 35034
replace enep = 2.496052 if riding == 35035
replace enep = 3.219828 if riding == 35036
replace enep = 3.180483 if riding == 35037
replace enep = 3.406 if riding == 35038
replace enep = 3.298907 if riding == 35039
replace enep = 3.144817 if riding == 35040
replace enep = 3.094636 if riding == 35041
replace enep = 2.569388 if riding == 35042
replace enep = 2.866155 if riding == 35043
replace enep = 3.391019 if riding == 35044
replace enep = 3.237906 if riding == 35045
replace enep = 2.561364 if riding == 35046
replace enep = 2.973007 if riding == 35047
replace enep = 2.718354 if riding == 35048
replace enep = 2.83546 if riding == 35049
replace enep = 2.628225 if riding == 35050
replace enep = 2.663286 if riding == 35051
replace enep = 2.860406 if riding == 35052
replace enep = 2.869297 if riding == 35053
replace enep = 2.823279 if riding == 35054
replace enep = 3.248786 if riding == 35055
replace enep = 2.195361 if riding == 35056
replace enep = 3.180335 if riding == 35057
replace enep = 2.90589 if riding == 35058
replace enep = 2.756825 if riding == 35059
replace enep = 2.532538 if riding == 35060
replace enep = 2.866184 if riding == 35061
replace enep = 2.842999 if riding == 35062
replace enep = 2.466012 if riding == 35063
replace enep = 2.705149 if riding == 35064
replace enep = 2.614521 if riding == 35065
replace enep = 2.936331 if riding == 35066
replace enep = 3.046914 if riding == 35067
replace enep = 2.921165 if riding == 35068
replace enep = 3.461053 if riding == 35069
replace enep = 3.333344 if riding == 35070
replace enep = 2.951566 if riding == 35071
replace enep = 2.67926 if riding == 35072
replace enep = 3.122183 if riding == 35073
replace enep = 2.316963 if riding == 35074
replace enep = 2.666526 if riding == 35075
replace enep = 3.151051 if riding == 35076
replace enep = 2.341503 if riding == 35077
replace enep = 3.028505 if riding == 35078
replace enep = 2.359602 if riding == 35079
replace enep = 2.610261 if riding == 35080
replace enep = 2.55264 if riding == 35081
replace enep = 2.798846 if riding == 35082
replace enep = 3.080731 if riding == 35083
replace enep = 2.835829 if riding == 35084
replace enep = 2.89878 if riding == 35085
replace enep = 3.033885 if riding == 35086
replace enep = 2.732996 if riding == 35087
replace enep = 2.827958 if riding == 35088
replace enep = 2.547315 if riding == 35089
replace enep = 2.641537 if riding == 35090
replace enep = 2.452728 if riding == 35091
replace enep = 2.551624 if riding == 35092
replace enep = 2.689279 if riding == 35093
replace enep = 2.476943 if riding == 35094
replace enep = 2.855143 if riding == 35095
replace enep = 3.015212 if riding == 35096
replace enep = 2.442397 if riding == 35097
replace enep = 2.94433 if riding == 35098
replace enep = 3.038859 if riding == 35099
replace enep = 3.131125 if riding == 35100
replace enep = 2.498873 if riding == 35101
replace enep = 2.295258 if riding == 35102
replace enep = 2.92161 if riding == 35103
replace enep = 2.81608 if riding == 35104
replace enep = 3.137647 if riding == 35105
replace enep = 2.624199 if riding == 35106
replace enep = 2.602051 if riding == 35107


*******************************
** INCUMBENT PARTY REELECTED **
*******************************

gen reelected = .

replace reelected = 1 if riding == 3501
replace reelected = 1 if riding == 3502
replace reelected = 1 if riding == 3503
replace reelected = 0 if riding == 3504
replace reelected = 0 if riding == 3505
replace reelected = 1 if riding == 3506
replace reelected = 1 if riding == 3507
replace reelected = 1 if riding == 3508
replace reelected = 1 if riding == 3509
replace reelected = 1 if riding == 35010
replace reelected = 0 if riding == 35011
replace reelected = 0 if riding == 35012
replace reelected = 1 if riding == 35013
replace reelected = 1 if riding == 35014
replace reelected = 0 if riding == 35015
replace reelected = 1 if riding == 35016
replace reelected = 1 if riding == 35017
replace reelected = 1 if riding == 35018
replace reelected = 0 if riding == 35019
replace reelected = 1 if riding == 35020
replace reelected = 1 if riding == 35021
replace reelected = 1 if riding == 35022
replace reelected = 1 if riding == 35023
replace reelected = 1 if riding == 35024
replace reelected = 1 if riding == 35025
replace reelected = 1 if riding == 35026
replace reelected = 1 if riding == 35027
replace reelected = 1 if riding == 35028
replace reelected = 1 if riding == 35029
replace reelected = 0 if riding == 35030
replace reelected = 1 if riding == 35031
replace reelected = 1 if riding == 35032
replace reelected = 1 if riding == 35033
replace reelected = 1 if riding == 35034
replace reelected = 1 if riding == 35035
replace reelected = 1 if riding == 35036
replace reelected = 1 if riding == 35037
replace reelected = 1 if riding == 35038
replace reelected = 0 if riding == 35039
replace reelected = 1 if riding == 35040
replace reelected = 1 if riding == 35041
replace reelected = 1 if riding == 35042
replace reelected = 1 if riding == 35043
replace reelected = 1 if riding == 35044
replace reelected = 0 if riding == 35045
replace reelected = 1 if riding == 35046
replace reelected = 1 if riding == 35047
replace reelected = 1 if riding == 35048
replace reelected = 1 if riding == 35049
replace reelected = 1 if riding == 35050
replace reelected = 1 if riding == 35051
replace reelected = 1 if riding == 35052
replace reelected = 0 if riding == 35053
replace reelected = 0 if riding == 35054
replace reelected = 1 if riding == 35055
replace reelected = 1 if riding == 35056
replace reelected = 1 if riding == 35057
replace reelected = 0 if riding == 35058
replace reelected = 1 if riding == 35059
replace reelected = 1 if riding == 35060
replace reelected = 0 if riding == 35061
replace reelected = 1 if riding == 35062
replace reelected = 1 if riding == 35063
replace reelected = 1 if riding == 35064
replace reelected = 1 if riding == 35065
replace reelected = 1 if riding == 35066
replace reelected = 1 if riding == 35067
replace reelected = 1 if riding == 35068
replace reelected = 1 if riding == 35069
replace reelected = 1 if riding == 35070
replace reelected = 1 if riding == 35071
replace reelected = 1 if riding == 35072
replace reelected = 1 if riding == 35073
replace reelected = 1 if riding == 35074
replace reelected = 1 if riding == 35075
replace reelected = 1 if riding == 35076
replace reelected = 1 if riding == 35077
replace reelected = 1 if riding == 35078
replace reelected = 1 if riding == 35079
replace reelected = 1 if riding == 35080
replace reelected = 1 if riding == 35081
replace reelected = 1 if riding == 35082
replace reelected = 1 if riding == 35083
replace reelected = 1 if riding == 35084
replace reelected = 1 if riding == 35085
replace reelected = 1 if riding == 35086
replace reelected = 1 if riding == 35087
replace reelected = 0 if riding == 35088
replace reelected = 1 if riding == 35089
replace reelected = 1 if riding == 35090
replace reelected = 1 if riding == 35091
replace reelected = 1 if riding == 35092
replace reelected = 1 if riding == 35093
replace reelected = 1 if riding == 35094
replace reelected = 1 if riding == 35095
replace reelected = 0 if riding == 35096
replace reelected = 1 if riding == 35097
replace reelected = 1 if riding == 35098
replace reelected = 1 if riding == 35099
replace reelected = 1 if riding == 35100
replace reelected = 1 if riding == 35101
replace reelected = 0 if riding == 35102
replace reelected = 0 if riding == 35103
replace reelected = 1 if riding == 35104
replace reelected = 1 if riding == 35105
replace reelected = 1 if riding == 35106
replace reelected = 1 if riding == 35107


***************************
** INDEPENDENT VARIABLES **
***************************

* Time

gen time = 0

* Gender

gen male = resp_gender

recode male (2=0)

* Age

gen age = age_num

* Education

gen education = quota_education

* Vote status (provincial)

gen vote_whole = 1 if q3 == 2
replace vote_whole = 0 if q3!=2 & q3!=. 

* Vote status (district)

gen vote_district = 1 if q3 == district_outcome
replace vote_district = 0 if q3!=district_outcome & q3!=. 

* Political discussion

gen discussion = q37

recode discussion (5=.)

replace discussion = 4 - discussion

gen discussion_3pts = 0 if discussion == 0
replace discussion_3pts = 0 if discussion == 1
replace discussion_3pts = 1 if discussion == 2
replace discussion_3pts = 2 if discussion == 3


***********************************
** PROVINCIAL-LEVEL EXPECTATIONS **
***********************************

* Forecasts

gen forecast_whole = q14

* Identify correct forecasts

gen correct_whole_d = 0 if forecast_whole!=2 & forecast_whole!=.
replace correct_whole_d = 1 if forecast_whole == 2


*********************************
** DISTRICT-LEVEL EXPECTATIONS **
*********************************

* Forecasts

gen forecasts_district = q13

* Identify correct forecasts

gen correct_district_d = 0 if forecasts_district!=district_outcome & forecasts_district!=.
replace correct_district_d = 1 if forecasts_district == district_outcome


**********
** SAVE **
**********

save "on2014_ipsos.dta", replace


********************************
** MAIN ANALYSES (PROVINCIAL) **
********************************

* Regression analysis and percentage of correct and incorrect forecasts (provincial)

logistic correct_whole_d discussion i.vote_whole age i.male education
estimates table, star(.05 .01 .001)

parmest, format(estimate min95 max95 %8.2f p %8.1e) list(,) saving(on2014_ipsos_parmest_provincial_full.dta, replace)

tab correct_whole_d if e(sample) == 1

set seed 1234

bsample 2000 if e(sample) == 1

logistic correct_whole_d discussion i.vote_whole age i.male education
estimates table, star(.05 .01 .001)

parmest, format(estimate min95 max95 %8.2f p %8.1e) list(,) saving(on2014_ipsos_parmest_provincial_random.dta, replace)


*************************************
** SUMMARY STATISTICS (PROVINCIAL) **
*************************************

label variable correct_whole_d "Election winner (DV)"
label variable correct_district_d "District winner (DV)"
label variable discussion "Discussion"
label variable vote_whole "Provincial vote"
label variable vote_district "District vote"
label variable age "Age"
label variable male "Gender (male = 1)"
label variable education "Education"
label variable enep "ENEP"
label variable margin "Margin"
label variable reelected "Reelected"

estpost tabstat correct_whole_d discussion vote_whole age male education if e(sample) == 1, statistics(n mean p50 sd min max) columns(statistics)

esttab using "on2014_ipsos_summary_provincial.tex", substitute("\begin{table}[htbp]" "\begin{table}[H]") cells("count(label(N) fmt(%9.0fc)) mean(fmt(%5.1f) label(Mean)) p50(fmt(%5.1f) label(Median)) sd(fmt(%5.1f) label(Std. dev.)) min(fmt(%5.1f) label(Min)) max(fmt(%5.1f) label(Max))") label width(\textwidth) nomtitle nonumber noobs booktabs title("Summary statistics -- 2014 Ontario provincial election (Ipsos), provincial level") replace

eststo clear


******************************
** MAIN ANALYSES (DISTRICT) **
******************************

* Regression analysis and percentage of correct and incorrect forecasts (district)

melogit correct_district_d discussion i.vote_district age i.male education enep i.reelected || riding: , or
estimates table, star(.05 .01 .001)

tab correct_district_d if e(sample) == 1


***********************************
** SUMMARY STATISTICS (DISTRICT) **
***********************************

label variable correct_whole_d "Election winner (DV)"
label variable correct_district_d "District winner (DV)"
label variable discussion "Discussion"
label variable vote_whole "Provincial vote"
label variable vote_district "District vote"
label variable age "Age"
label variable male "Gender (male = 1)"
label variable education "Education"
label variable enep "ENEP"
label variable margin "Margin"
label variable reelected "Reelected"

estpost tabstat correct_district_d discussion vote_district age male education if e(sample) == 1, statistics(n mean p50 sd min max) columns(statistics)

esttab using "on2014_ipsos_summary_district.tex", substitute("\begin{table}[htbp]" "\begin{table}[H]") cells("count(label(N) fmt(%9.0fc)) mean(fmt(%5.1f) label(Mean)) p50(fmt(%5.1f) label(Median)) sd(fmt(%5.1f) label(Std. dev.)) min(fmt(%5.1f) label(Min)) max(fmt(%5.1f) label(Max))") label width(\textwidth) nomtitle nonumber noobs booktabs title("Summary statistics -- 2014 Ontario provincial election (Ipsos), district level") replace

eststo clear

log close